public function actionExportToCsv(string $table_name)
{
        set_time_limit(0);
        echo "export ". $table_name . "start ....";
        echo "\n";
        $conn = mysqli_connect("localhost","root","", "tumor");
        $sql = "SELECT count(*) as num FROM ccle_mutations";
        $count = Yii::$app->db->createCommand($sql)->queryScalar();
        $headArr = ['ID',
'Hugo_Symbol',
'Entrez_Gene_Id',
'NCBI_Build',
'Chromosome',
'Start_position',
'End_position',
'Strand',
'Variant_Classification',
'Variant_Type',
'Reference_Allele',
'Alternate_Allele',
'dbSNP_RS',
'dbSNP_Val_Status',
'Genome_Change',
'Annotation_Transcript',
'DepMap_ID',
'cDNA_Change',
'Codon_Change',
'Protein_Change',
'isDeleterious',
'isTCGAhotspot',
'TCGAhsCnt',
'isCOSMIChotspot',
'COSMIChsCnt',
'ExAC_AF',
'Variant_annotation',
'CGA_WES_AC',
'HC_AC',
'RD_AC',
'RNAseq_AC' 
'SangerWES_AC',
'WGS_AC'];
        $path =Yii::getAlias("@console").'/runtime/data/'.$table_name.'_'.time().'.csv';
         $fp = fopen($path, "w") or die("Unable to open file!\n");
         fwrite($fp, chr(0xEF).chr(0xBB).chr(0xBF));
         fputcsv($fp,$headArr);
        
        if($count)
        {
            $limit = 100; //每页导100条数据
            $page = 1;
            $offset = 0;
            while ($offset <= $count) {
                //获取每一页的数据并写入文件
                $offset = ($page-1) * $limit;
                $sql = "SELECT * FROM ccle_mutations ORDER BY id LIMIT ".$offset.','.$limit;
                $data = Yii::$app->db->createCommand($sql)->queryAll();
                if(!$data)
                {
                    break;
                }
                foreach ($data as $value) {
                    fputcsv($fp,$value);
                }
                $page++; //翻页
            }
        }
        fclose($fp);
        echo $path ."\n";
        return ;
}